#ifndef __THREAD_H_
#define __THREAD_H_

#include <pthread.h>
#include <unistd.h>

#include "Mutex.h"

class Thread {
  private:
    static void *start_routine(void *arg);

  protected:
    Mutex mutex;
    pthread_t thread;

    virtual void *run() = 0;

  public:
    Thread();
    virtual ~Thread();

    int start();
    void *join();
    void exit();
};
#endif
